fn main() {
    println!("Hello, world!");
    let num = 7;
    if num < 5 {
        println!("小于5");
    } else {
        println!("大于5");
    };
    let condition = false;
    let number = if condition { 5 } else { 6 };
    println!("number{}", number);
    loopfn();
    whilefn();
    forfn();
}
fn loopfn() {
    let mut x = 0;
    let _res = loop {
        if x == 100 {
            break x;
        }
        x += 1;
    };
    println!("值{}", x)
}
fn whilefn() {
    let mut number = 3;
    while number != 0 {
        println!("whilefn的值{}", number);
        number -= 1
    }
}
fn forfn() {
    let a = [10, 20, 30, 40, 50];
    for element in a {
        println!("element{}", element)
    }
    for number in (1..4).rev() {
        println!("number{}", number)
    }
}
